class Solution:
    def reversePairs(self, nums) -> int:
        index = 0
        res = 0
        while index<len(nums)-1:
            bjnum = nums[index]
            for i in range(index+1,len(nums)):
                if nums[i]<bjnum:
                    res+=1
            index+=1
        print(res)
if __name__ == '__main__':
    s = Solution()
    s.reversePairs([7,5,6,4])